package com.ziyueyuwen.xiniao.dao;

import com.ziyueyuwen.xiniao.bean.ZyClassUser;
import com.ziyueyuwen.xiniao.bean.ZyUser;
import com.ziyueyuwen.xiniao.bean.vo.ZyClassUserVO;
import com.ziyueyuwen.xiniao.enums.ClassUserTypeEnum;
import com.ziyueyuwen.xiniao.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
/**
 * @author wancheng
 */
public interface ZyClassUserMapper extends BaseMapper<ZyClassUser>{
    /**
     * 获取班级用户
     * @param classId
     * @return
     */
    List<ZyClassUserVO> getByClassId(@Param("classId") Integer classId);

    /**
     * 获取班级用户
     * @param classId
     * @param userType
     * @return
     */
    List<ZyClassUserVO> getUser(@Param("classId") Integer classId, @Param("userType")ClassUserTypeEnum userType);

    /**
     * 删除
     * @param classId
     * @param userType
     */
    void deleteByClassId(@Param("classId") Integer classId, @Param("userType")ClassUserTypeEnum userType);

    /**
     * 批量保存
     * @param classUsers
     */
    void insertBatch(@Param("classUsers") List<ZyClassUser> classUsers);

    /**
     * 获取老师
     * @param lessonId
     * @return
     */
    ZyClassUserVO getTeacherByLessonId(Integer lessonId);

    /**
     *获取班级的老师 和 其他老师
     * @param classId
     * @return
     */
    List<ZyClassUserVO> getClassTeacher(@Param("classId") Integer classId);

    /**
     * 获取学生人数
     * @param classId
     * @return
     */
    Integer getStudentCount(Integer classId);
}